/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fi.uba.algo3.tp3.modelo.contenedor;

import ar.uba.fi.algo3.titiritero.Posicionable;
import fi.uba.algo3.tp3.modelo.inanimados.Comible;
import fi.uba.algo3.tp3.modelo.inanimados.Obstaculo;
import fi.uba.algo3.tp3.modelo.inanimados.ObstaculoFijo;
import java.util.Collection;
import java.util.LinkedList;

/**
 *
 * @author ariel
 */
public class LaberintoContenedor implements Posicionable {
    private Collection<Obstaculo> obstaculos;
    private Collection<Comible> comibles;
    private Integer ancho;
    private Integer alto;
    private JaulaBean jaula;


    public LaberintoContenedor(int alto,int ancho,JaulaBean jaula) {
        obstaculos = new LinkedList<Obstaculo>();
        comibles = new LinkedList<Comible>();
        this.ancho=ancho;
        this.alto=alto;
        this.jaula=jaula;
    }

    @Override
    public int getX() {
        return 0;
    }

    @Override
    public int getY() {
        return 0;
    }

    public Collection<Obstaculo> obtenerObstaculos() {
        Collection<Obstaculo> obstaculosAux=new LinkedList<Obstaculo>();
        obstaculosAux.addAll(obstaculos);
        obstaculosAux.add(jaula);
        return obstaculosAux;
    }

    public Collection<Comible> obtenerComibles() {
        return comibles;
    }

    public void agregarObstaculo(Obstaculo obstaculo){
        obstaculos.add(obstaculo);
    }

    public void agregarComible(Comible comible){
        comibles.add(comible);
    }

    public void removerOstaculo(Obstaculo obstaculo){
        obstaculos.remove(obstaculo);
    }

    public void removerComible(Comible comible){
        comibles.remove(comible);
    }

    public void reestablecerLaberinto(){
        for(Comible comible : comibles) {
            comible.restablecer();
        }
    }

    public Integer getAlto() {
        return alto;
    }

    public Integer getAncho() {
        return ancho;
    }

    public void setAlto(int alto){
        this.alto = alto;
    }

    public void setAncho(int ancho){
        this.ancho = ancho;
    }

    public ObstaculoFijo obtenerJaula() {
        return jaula;
    }

    public int getCantidadDeComibles() {
        // No agergo el punto comible
        return (comibles.size()-1);
    }

    public void setComibles(Collection<Comible> comibles) {
        this.comibles = comibles;
    }

    public void setObstaculos(Collection<Obstaculo> obstaculos) {
        this.obstaculos = obstaculos;
    }

    public Collection<Comible> getComibles() {
        return comibles;
    }

    public Collection<Obstaculo> getObstaculos() {
        return obstaculos;
    }
    
}
